package com.example.concurrency.singleton;

import com.example.concurrency.annotation.ThreadSafe;

/**
 * @author 文希
 * @create 2019-05-16 23:40
 */
@ThreadSafe
public class SingletonExample6 {

    // 私有构造函数
    private SingletonExample6() {

    }

    // 单例对象
    private static SingletonExample6 instance = null;

    static {
        instance = new SingletonExample6();
    }

    // 静态方法
    public static SingletonExample6 getInstance(){
        return instance;
    }

}
